<?php 
use yii\helpers\Html;
use yii\widgets\LinkPager;
use yii\helpers\Url;
?>
<style>
	.form-inline{width: auto;}
	.form-inline input[type="text"]{height: 40px;line-height: 40px;vertical-align: middle;}
	.btnMd{width: 100px; color: #fff;border-radius: 6px; height: 40px;line-height: 40px;vertical-align: top;}
	.btnMd input[type="submit"]{display: block; width: 100%; background: 0;border:0;font-size: 17px;vertical-align: middle}
	@media (max-width: 1280px){
		.form-inline input[type="text"],
		.select{width: 98px;}
	}
</style>
  <div class="row borB">
		<div class="container lh30">
			<span class="z">
				<!--<a href="#">首页</a>&gt;
				<a href="#">订单管理</a>&gt;
				<a href="#">客户详情</a>-->
				<?= isset($this->params['crumbs']) ? $this->params['crumbs'] : '' ?>
			</span>
			<span class="y">
				<a href="#"></a>
			</span>
		</div>
		<div class="right_site right_52">
			<span class="z">
				<form name="form" action=""  method="post" >
					<input type="hidden" name="" value="" id="upload_id" />
					<input type="submit" style="display:none;" id="upload_sub" />
				</form>

			</span>
		</div>
</div>
		<div class="container">
			<div class="lh45 clearfix mg20-y">
				<div class="pull-left">
					<a href="<?=Url::toRoute('bossmanage/add') ?>" class="add_upload btnBg">新增老板</a>
				</div>
				<div class="pull-right">
					<form class="form-inline" action="">
						<div class="form-group">
							<label for="">账户名</label>
							<input type="text" name="account" value="<?=$account?>">
						</div>
						
						<div class="form-group">
							<label for="">老板名</label>
							<input type="text" name="boss_name" value="<?=$bossName?>">
						</div>

						<div class="form-group">
							<label for="">美容院</label>
							<input type="text" name="shop_name" value="<?=$shopName?>">
						</div>

						<div class="form-group">
							<label for="">电话</label>
							<input type="text" name="phone" value="<?=$phone?>">
						</div>

						<div class="form-group">
							<label for="">状态</label>
							<div class="select">
								<select name="state" id="">
									<option value="0" <?php if($state==0):?> selected="selected" <?php endif;?>>全部</option>
									<option value="1" <?php if($state==1):?> selected="selected" <?php endif;?>>正常</option>
									<option value="2" <?php if($state==2):?> selected="selected" <?php endif;?>>禁用</option>
								</select>
							</div>
						</div>

						<div class="form-group">
							<div class="btnMd">
								<input class="" type="submit" value="搜索">
							</div>

						</div>
					</form>
				</div>
			</div>
				<table class="table table-bordered">
					<thead>
						<tr>
							<th style="text-align:center">日期</th>
							<th style="text-align:center">账户名称</th>
							<th style="text-align:center">老板名称</th>
							<th style="text-align:center">美容院</th>
							<th style="text-align:center">所属代理商</th>
							<th style="text-align:center">联系电话</th>
							<th style="text-align:center">线上店铺数量</th>
							<th style="text-align:center">状态</th>
							<!-- <th style="text-align:center">授权期限</th> -->
							<th style="text-align:center">操作</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($model as $r) {?>
						<tr>
							<td class="center"><?=Html::encode($r['create_time'])?></td>
							<td class="center"><?=Html::encode($r['login_name'])?></td>
							<td class="center"><?=Html::encode($r['user_name'])?></td>
							<td class="center"><?=Html::encode($r['shop_name'])?></td>
							<td class="center"><?=Html::encode($r['agent_name']['agent_name'])?></td>
							<td class="center"><?=Html::encode($r['login_name'])?></td>
							<td class="center"><?=Html::encode($r['online_count'])?></td>
							<td class="center">
								<?php if($r['status']==1){?>
									正常
								<?php }else{?>
									禁用
								<?php }?>
							</td>
							<!-- <td class="center"><?//=Html::encode($r['end_time'])?></td> -->
							<td class="center">
								<a class="edit btn btn-sm btn-edit" href="<?=Url::toRoute(['bossmanage/edit','id' => $r['boss_uid']]) ?>">修改</a>
								<?php if($r['status']==1){?>
									<a class="edit btn btn-sm btn-del" href="<?=Url::toRoute(['bossmanage/disable','id' => $r['boss_uid']]) ?>">禁用</a>
								<?php }else{?>
									<a class="edit btn btn-sm btn-edit" href="<?=Url::toRoute(['bossmanage/enabled','id' => $r['boss_uid']]) ?>">启用</a>
								<?php }?>
							</td>
						</tr>
						<?php }?>
					</tbody>
				</table>
				<div class="page">
<?=LinkPager::widget([
    'pagination' => $page,
	'firstPageLabel' => '首页',
	'nextPageLabel' => '下一页',
	'prevPageLabel' => '上一页',
	'lastPageLabel' => '末页',
]); ?>
				</div>
				
				

		</div>
